Skip to content

Send update_issue_suggestions feature flag for set_issue_fields mutation#2638

Merged
boazreicher merged 4 commits into
mainfrom
boazreicher/add-suggestions-and-rationale-to-issue-fields
Jun 10, 2026
Merged

Send update_issue_suggestions feature flag for set_issue_fields mutation#2638
boazreicher merged 4 commits into
mainfrom
boazreicher/add-suggestions-and-rationale-to-issue-fields

Conversation

@boazreicher

Copy link
Copy Markdown
Contributor

Summary

Gate the set_issue_fields GraphQL mutation behind the update_issue_suggestions feature flag so the rationale and suggest input fields are accepted by the API.

Why

The rationale and suggest input fields on IssueFieldCreateOrUpdateInput are only available when the update_issue_suggestions GraphQL feature flag is enabled. Without it, mutations using those inputs are rejected.

What changed

  • pkg/github/issues_granular.go: Wrap the setIssueFieldValue mutation context with ghcontext.WithGraphQLFeatures("update_issue_suggestions") so the existing GraphQLFeaturesTransport emits the appropriate GraphQL-Features header.
  • pkg/github/granular_tools_test.go: Add a test that builds the production transport chain and asserts the mutation request carries the update_issue_suggestions feature flag header.

MCP impact

  • No tool or API changes

The tool schema is unchanged; only the outbound GraphQL request headers are affected.

Prompts tested (tool changes only)

  • n/a

Security / limits

  • No security or limits impact

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed

Copilot AI review requested due to automatic review settings June 8, 2026 05:25
@boazreicher boazreicher requested a review from a team as a code owner June 8, 2026 05:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures the set_issue_fields granular tool can use the rationale and suggest inputs by opting into GitHub’s update_issue_suggestions GraphQL feature flag on the setIssueFieldValue mutation request (via the GraphQL-Features header), aligning the MCP server’s outbound GraphQL behavior with the API’s feature-gated schema.

Changes:

  • Wrap the setIssueFieldValue mutation call in GranularSetIssueFields with a context that enables update_issue_suggestions.
  • Add a transport-chain test that asserts the outbound mutation request includes GraphQL-Features: update_issue_suggestions.
Show a summary per file
File Description
pkg/github/issues_granular.go Sets a GraphQL feature-flagged context for the setIssueFieldValue mutation so rationale/suggest inputs are accepted.
pkg/github/granular_tools_test.go Adds a production-like transport-chain test to verify the GraphQL-Features header is emitted on the mutation request.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@angeydono-lang

Copy link
Copy Markdown

boazreicher/add-suggestions-and-rationale-to-issue-fields

@angeydono-lang

Copy link
Copy Markdown

#2638 (comment)

The GitHub GraphQL API does not yet accept the per-field confidence input
on setIssueFieldValue mutations. Hide it from the user-facing schema and
drop it from the mutation payload unless the new update_issue_confidence
feature flag is enabled so users do not try to use it before the API
supports it.
Comment thread pkg/github/issues_granular.go Outdated
Comment on lines +1109 to +1119
if deps.IsFeatureEnabled(ctx, FeatureFlagIssueConfidence) {
confidence, err := OptionalParam[string](fieldMap, "confidence")
if err != nil {
return utils.NewToolResultError(err.Error()), nil, nil
}
if confidence != "" && confidence != "low" && confidence != "medium" && confidence != "high" {
return utils.NewToolResultError("confidence must be one of: low, medium, high"), nil, nil
}
if confidence != "" {
input.Confidence = &confidence
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the confidence param in the input schema, it's unlikely models will call this with the confidence parameter. I'm not seeing where this is conditionally hidden in the schema (I don't think theres currently a mechanism do that), rather it's just removed?

boazreicher commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Great catch! You're right—the confidence parameter was completely missing from the schema, which prevented models from knowing about it at all.

I've now added it back. Since the backend now supports confidence unconditionally, I've removed the temporary feature-flag gating we had in place:

Changes made:

  • Schema: Added confidence (string: "low", "medium", or "high") to the fields array items in set_issue_fields
  • Handler: Removed the IsFeatureEnabled(FeatureFlagIssueConfidence) gate so confidence is always parsed and validated
  • Feature flag: Removed the obsolete FeatureFlagIssueConfidence constant and its allowlist entry since it's no longer needed
  • Tests: Updated confidence tests to reflect unconditional support
  • Toolsnap: Updated the schema snapshot to document the new field

All tests and linting pass. Models will now see and can supply the confidence parameter.

(posted by AI)

Comment thread pkg/github/issues_granular.go Outdated
Type: "string",
Description: "How confident you are in this choice. Use 'high' for clear signal or explicit user request, 'medium' for reasonable inference with some ambiguity, 'low' for best guess with limited signal.",
Enum: []any{"low", "medium", "high"},
Description: "How confident you are in this field value: low, medium, or high.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to change this language and remove the enum? I would keep the enum and description here. The Enum is likely going to be a stronger indicator than text in the description field, and restricts the values to one of those three.

@boazreicher boazreicher merged commit d42bb3e into main Jun 10, 2026
19 checks passed
@boazreicher boazreicher deleted the boazreicher/add-suggestions-and-rationale-to-issue-fields branch June 10, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants